﻿<%@ Page Language="C#" MasterPageFile="Site.Master" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>


<asp:Content ID="Content1" runat="server"  ContentPlaceHolderID="Headers">

<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAel8IPnI5wEvR5PtOvUjVJxR27VTUqgbR8dNmH64FZ-vxUR2MiBSF3HjombTc31cw-p0IB0OSNdE7PQ"
      type="text/javascript"></script>

</asp:Content>


<asp:Content ID="aboutContent" ContentPlaceHolderID="MainContent" runat="server">


    
    <h2>My Geo Twitter</h2>
    <p>What are you doing?</p>
    <div>
    
        <asp:TextBox ID="TextBoxInput" runat="server" 
            TextMode="MultiLine" Width="339px"></asp:TextBox>
        <asp:Button ID="ButtonUpdate" runat="server" Text="Update" 
            onclick="ButtonUpdate_Click" />
        
    
            <br />
        Where are you?<br />
            <asp:TextBox ID="textPosition" runat="server"></asp:TextBox>
        
    
            <asp:Label ID="LabelError" runat="server" Text=""></asp:Label>
        
    
    </div>
    <div>
           
          
        <div id="map" style="width: 500px; height: 300px"></div>      
        
        <script type="text/javascript">
        //<![CDATA[
        var marker = null;
        
        function load() {
          if (GBrowserIsCompatible()) {
            var map = new GMap2(document.getElementById("map"));            
            map.addControl(new GLargeMapControl());
            map.setCenter(new GLatLng(49.496675,-102.65625), 3);
            
            // Do georss
            var geoXml = new GGeoXml('<%=_sLinkToGeoRSS%>');
            map.addOverlay(geoXml);
            
            
            GEvent.addListener( map, "click", function(o,p)
            {
                if ( marker == null )
                    marker = new GMarker( p );
                else
                {
                    map.removeOverlay( marker );
                    marker = new GMarker( p );
                }                
                            
              map.addOverlay( marker );    
              
              var textpos = document.getElementById('<%=textPosition.ClientID%>');
              textpos.value = p;             
              
            });

           
//            map.Event.addListener(gmap, "move", function() {
//        var center = gmap.getCenter();
//        document.getElementById("latlon").innerHTML = center.toString();
//        });

                /*function createMarker(point, number) 
        {  
            var marker = new GMarker(point);  
            var message = ["This","is","where","I","am"];  
            marker.value = number;  
            GEvent.addListener(marker, "click", function() 
            {    
                var myHtml = "<b>#" + number + "</b><br/>" + message[number -1];
                map.openInfoWindowHtml(point, myHtml);              
            }
            );
            return marker;
        }*/
          }
        }
        
        //]]>
        </script>
       
    </div>
        
        <div>
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                Width="416px">
                <Columns>
                    <asp:ImageField DataImageUrlField="userimage">
                    </asp:ImageField>
                    <asp:ButtonField DataTextField="name" Text="name" />
                    <asp:BoundField DataField="text" />                    
                </Columns>
            </asp:GridView>
        </div>
        
</asp:Content>
